package com.xj.service.fegin;

import com.xj.service.domain.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "product")
public interface ProductService {
    @GetMapping("/product/{pid}")
    Product findById(@PathVariable("pid") Integer pid);

    /***
     * 扣减库存
     * @param pid
     * @param num
     */
    @RequestMapping("/product/reduceInventory")
    void reduceInventory(@RequestParam("pid") Integer pid, @RequestParam("num") int num);
}
